//
//  YCMainController.m
//  YCAdapterMode
//
//  Created by 安跃超 on 2018/12/3.
//  Copyright © 2018年 安跃超. All rights reserved.
//

#import "YCMainController.h"
#import "YCHomeViewController.h"
#import "YCMainModel.h"
#import "YCMainModelAdapter.h"

@interface YCMainController()
@end

@implementation YCMainController

-(NSMutableArray<YCMainViewAdapter *> *)getDataSource{
    NSMutableArray  *dataSource  = [NSMutableArray array];

    YCMainModel *model1 = [[YCMainModel alloc] initWithIcon:@"tab_home_normal" selectIcon:@"tab_home_press" attNomal:[self nomalSetting] attSelect:[self selectSetting] title:@"首页" destClass:[YCHomeViewController class]];
    YCMainViewAdapter *adapter1 = [[YCMainViewAdapter alloc] initWithData: model1];
    [dataSource addObject:adapter1];

    YCMainModel *model2 = [[YCMainModel alloc] initWithIcon:@"tab_hot_mormal" selectIcon:@"tab_hot_press_1" attNomal:[self nomalSetting] attSelect:[self selectSetting] title:@"热点" destClass:[YCHomeViewController class]];
    YCMainViewAdapter *adapter2 = [[YCMainViewAdapter alloc] initWithData: model2];
    [dataSource addObject:adapter2];

    YCMainModel *model3 = [[YCMainModel alloc] initWithIcon:@"tab_mechanism" selectIcon:@"tab_mechanism_press" attNomal:[self nomalSetting] attSelect:[self selectSetting] title:@"发现" destClass:[YCHomeViewController class]];
    YCMainViewAdapter *adapter3 = [[YCMainViewAdapter alloc] initWithData: model3];
    [dataSource addObject:adapter3];

    YCMainModel *model4 = [[YCMainModel alloc] initWithIcon:@"tab_me_normal" selectIcon:@"tab_me_press" attNomal:[self nomalSetting] attSelect:[self selectSetting] title:@"我的" destClass:[YCHomeViewController class]];
    YCMainViewAdapter *adapter4 = [[YCMainViewAdapter alloc] initWithData: model4];
    [dataSource addObject:adapter4];

    return dataSource;
}

- (NSDictionary *)nomalSetting {
    return [NSDictionary dictionaryWithObjectsAndKeys:YCHexColor(@"929292"),NSForegroundColorAttributeName, nil];
}

- (NSDictionary *)selectSetting {
    return [NSDictionary dictionaryWithObjectsAndKeys:YCHexColor(@"ff4248"),NSForegroundColorAttributeName, nil];
}

@end

